package com.net.framework.help.widget.tagview;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ToggleButton;

import com.net.framework.help.R;

/**
 * Author：xiaobin.zhang
 * Email：154722566@qq.com
 * Date：2018-01-16 15:47
 * Desc：<--功能描述-->
 */
public class TagView extends ToggleButton {
    private boolean mCheckEnable = true;

    public TagView(Context paramContext) {
        super(paramContext);
        init();
    }

    public TagView(Context paramContext, AttributeSet paramAttributeSet) {
        super(paramContext, paramAttributeSet);
        init();
    }

    public TagView(Context paramContext, AttributeSet paramAttributeSet, int paramInt) {
        super(paramContext, paramAttributeSet, 0);
        init();
    }

    private void init() {
        setTextOn(null);
        setTextOff(null);
        setText("");
        setBackgroundResource(R.color.trans);
    }

    public void setCheckEnable(boolean paramBoolean) {
        this.mCheckEnable = paramBoolean;
        if (!this.mCheckEnable) {
            super.setChecked(false);
        }
    }

    public void setChecked(boolean paramBoolean) {
        if (this.mCheckEnable) {
            super.setChecked(paramBoolean);
        }
    }
}